﻿using System;
using System.Collections.Generic;
using System.Web;

/// <summary>
/// Summary description for AutoNum
/// </summary>
public class AutoNum
{
    private int i;
    private int increment;

    // Constructor
    public AutoNum() { i = 1; increment = 1; }
    public AutoNum(int start, int increment)
    {
        i = start;
        this.increment = increment;
    }

    // Get Next sequence
    public int GetNext()
    {
        int _r = i;
        i += increment;
        return _r;
    }

    // Reset value
    public void Reset()
    {
        i = 1;
        increment = 1;
    }

    // property Start
    public int Start
    {
        get
        {
            return i;
        }
        set
        {
            i = value;
        }
    }

    //property increment
    public int Increment
    {
        get
        {
            return i;
        }
        set
        {
            increment = value;
        }
    }

}